package com.sxbbc.common.basics.enums;

import com.sxbbc.common.basics.utils.calculation.CalcuUtils;

/**
 * 统一下单支付 业务类型枚举
 * @author arno
 *
 */
public enum ServiceEnums {

	ORDER(1,"商城订单购买"), //
	RECHARGE_MONEY(2,"充值余额"), //X
	UP_LEVEL(3,"会员升级"), //X
	OFFLINE_BUY(4,"线下买单"),  //
	OFFLINE_ORDER(7,"线下订单购买"), //
	FARM_ORDER(10,"农场订单购买"), //
	FARM_LOGISTICS_ORDER(11,"物流提鸡订单购买"); //
	private int id;
	private String name;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	private  ServiceEnums(int id,String name) {
		this.id=id;
		this.name=name;
	}
	
	public static String getName(int id) {
		for(ServiceEnums e:ServiceEnums.values()) {
			if(id==e.getId()) {
				return e.getName();
			}
		}
		return "";
	}
	
	public static ServiceEnums getEnums(Integer id){
		for(ServiceEnums o:ServiceEnums.values()){
			if(CalcuUtils.getInstance().isEquals(id, o.getId())){
				return o;
			}
		}
		return null;
	}
}
